﻿project(txr_algo_dlm_v1 LANGUAGES CXX CUDA)

add_definitions(
-DTK_TXR_ALGO_DLM_V1_LIB
-DENABLE_CRYPT
-DCUDNN_HALF
-DCUDNN
-D_SCL_SECURE_NO_WARNINGS
-D_CRT_SECURE_NO_WARNINGS
-D_CRT_RAND_S
-DGPU
-D_XKEYCHECK_H
-D_TIMESPEC_DEFINED
)

include_directories(${BOOST_INCLUDEDIR})
link_directories(${Boost_LIBRARY_DIRS})

include_directories(
	${Qt5Core_INCLUDE_DIRS}
	${MY_CUDA_INCLUDE_DIRS}
	${MY_CUDNN_INCLUDE_DIR}
	${MY_PTHREADS_INCLUDE_DIR}
	${MY_STB_INCLUDE_DIR}
	${MY_CRYPTOPP_INCLUDE_DIR}
)
link_directories(
	${MY_CUDA_LIBRARY_DIRS}
	${MY_CUDNN_LIB_DIR}
	${MY_PTHREADS_LIB_DIR}
	${MY_CRYPTOPP_LIB_DIR}
)

set(ALGO_DLM_V1_LIBS 
	Qt5::Core
	Qt5::Gui
	${MY_CUDA_LIBS} curand cublas
	dxgi
	${MY_CUDNN_LIB}
	${MY_PTHREADS_LIB}
	${MY_CRYPTOPP_LIB}
)

file(GLOB_RECURSE CURRENT_HEADERS  *.h *.hpp)
file(GLOB_RECURSE CURRENT_SOURCES  *.c *.cpp)
file(GLOB_RECURSE CURRENT_CUDA_SOURCES *.cu *.cuh)
source_group("Include" FILES ${CURRENT_HEADERS}) 
source_group("Source" FILES ${CURRENT_SOURCES})
source_group("CuSource" FILES ${CURRENT_CUDA_SOURCES})

add_library(txr_algo_dlm_v1 SHARED 
	${CURRENT_HEADERS} 
	${CURRENT_SOURCES}
	${CURRENT_CUDA_SOURCES}
	)

target_link_libraries(txr_algo_dlm_v1 PRIVATE ${ALGO_DLM_V1_LIBS})

install(TARGETS txr_algo_dlm_v1 DESTINATION 
        RUNTIME DESTINATION bin
        ARCHIVE DESTINATION lib
        LIBRARY DESTINATION lib
)